//
//  RequestPlugin.m
//  HU
//
//  Created by 严浩 on 15/3/11.
//
//

#import "RequestPlugin.h"
#import <Cordova/CDVPluginResult.h>
#import <AVOSCloud/AVOSCloud.h>

@implementation RequestPlugin
- (void)setUserId:(CDVInvokedUrlCommand*)command
{
    int uid;
    [[command.arguments objectAtIndex:0] getValue:&uid];
    
    //int uid = [command.arguments objectAtIndex:0];
    NSString *userId = [NSString stringWithFormat:@"%d", uid];
    
    AVInstallation *currentInstallation = [AVInstallation currentInstallation];
    [currentInstallation setObject:userId forKey:@"uid"];
    //当然别忘了任何currentInstallation的变更后做保存
    [currentInstallation saveInBackground];
    
}

@end